<!DOCTYPE html
	PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>卓越--拍卖信息发布</title>
		<link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon" />
		<link href="JsCss/common.css" rel="stylesheet" media="screen" type="text/css" />
		<script type="text/javascript" src="JsCss/jquery-1.4.2.min.js"></script>
		<script type="text/javascript" src="JsCss/jquery.min.js"></script>
		<script type="text/javascript" src="JsCss/vue.min.js"></script>
		<script type="text/javascript" src="JsCss/axios.min.js" charset="utf-8"></script>
		<script type="text/javascript" src="JsCss/daojishi.js"></script>
		<script type="text/javascript" src="JsCss/jquery.ui.widget.js"></script>
		<script type="text/javascript" src="JsCss/jquery.iframe-transport.js"></script>
		<script type="text/javascript" src="JsCss/jquery.fileupload.js"></script>
		<script src="JsCss/index.js"></script>
	</head>

	<body>
		<div class="header">
			<ul class="top-link">
				<li class="title"><a href="#"
						onclick="this.style.behavior='url(#default#homepage)';this.setHomePage('huiyuaninsert.html');"
						title='设置本站为浏览器首页(启始页)'>设为首页</a></li>
				<li class="pi"></li>
				<li class="title"><a target=_top href="register.html">注册</a></li>
				<li class="pi"></li>
				<li class="title"><a href="login.html">登录</a></li>
			</ul>

			<div class="logo"><a href="index.html"><img src="images/logo.png" width="250" height="82" /></a></div>
			<div class="menu">
				<ul>
					<li><a href="about.html">关于我们</a><span>about us</span></li>
					<li class="active"><a href="auctioning.html">拍卖信息</a><span>Auction information</span></li>
					<li><a href="auctioninsert.html">商品展示</a><span>Product showcase</span></li>
					<li><a href="showData.html">个人信息</a><span>Personal information</span></li>
					<li><a href="chargeMoney.html">资金管理</a><span>Money management</span></li>

				</ul>
			</div>
		</div>

		<div class="clr50"></div>
		<div class="zy_banner_bg">
			<div class="zy_banner"></div>
		</div>



		<div class="zy_main" id="content">
			<div class="Left_subMenu">
				<div class="top_bg"></div>
				<div class="c_bg">
					<div class="title">拍卖信息</div>
					<ul>
						<li><a href="auctioning.html">正在竞拍</a></li>
						<li><a href="showAuction.html">我的拍卖</a></li>
						<li class="activer"><a href="auctioninsert.html">发布拍品</a></li>
						<li><a href="myOrder.html">我的订单</a></li>
					</ul>
				</div>
				<div class="bottom_bg"></div>

				<div class="ph">
					<img src="images/ph.png" width="169" height="67" />
				</div>
			</div>

			<div class="zy_right">
				<div class="position">当前位置：<a href="#">拍卖信息</a> > <a href="#">发布拍品</a></div>
				<div class="zy_title">
					<p>发布拍品<span>Auction information</span></p>
				</div>
				<br>
				<!-- 拍品信息录入  begin-->
				<div style="position:relative;left:200px;color: red"> 	</div>
				<div class="cz-guestbook">
					<form action="" class="cz-form" method="post" id="form1">
						<p>商品名称：<input placeholder="请输入商品名称" 
								class="cz-birds" style="width:443px"
								name="gname"></p>
						<p>商品类型：<select class="cz-birds" style="width:455px;height: 24px" 
						name="tid">
						
								<option value="">请选择</option>
								<option v-for="item in ptypelist" :value="item.tid">{{item.tname}}</option>
							</select></p>
						<p>起拍价格：<input type="number" class="cz-birds"
								style="width:443px" name="bprice"></p>
						<p>增长价格：<input type="number" 
								class="cz-birds" style="width:443px"
								name="increase"></p>
						<p>保证金额：<input type="number" value="" 
								class="cz-birds" style="width:443px" name="abmoney"></p>
						<p>开拍时间：<input type="date"  class="cz-birds"
								style="width:443px" name="stime"></p>
						<p>结束时间：<input type="date"  class="cz-birds"
								style="width:443px" name="etime"></p><span id="timeMsg"></span><br>
						<div id="fileDiv" style="width: 200px; height: 100px;" style="position: relative;" @click="clkuploadBtn()">
							<div style="position: absolute;">图片上传:</div>
							<input style="display: none;" type="file" id="myPic" name="pic" 
									class="cz-birds" style="width:440px" @change="changeImg()">
							<div id="imgDiv" style="position: absolute; left: 880px; ;">
								<img id="myImg" src="" style="width: 200px; height: 100px; border: 1px solid gray;">
							</div>
							
						</div>
						<p>备注说明：<textarea  class="cz-birds"
								style="width:443px" name="abackup"></textarea></p>
						<div align="center">
							<input type="button" @click="addAuction" class="cz-gkbutton" />
						</div>
					</form>
				</div>
				<!-- 拍品信息录入  end-->

				<div class="clr10"></div>
			</div>
		</div>

		<div id="footer-top">
			<div class="footer-text">
				© 小佟拍卖行
			</div>
		</div>
		
			
		

		<script>
			var vm = new Vue({
				el: '#content',
				data:{
					ptypelist:[]
				},
				methods: {
					addAuction: function() {
						
							 //location.reload();
							// 提交表单中的输入控件的值
							var formData = new FormData(document.getElementById("form1"));
							axios({
							url: "/auction/fabu",
							data: formData,
							
							method:'post',
							headers:{"content-type":"multipart/form-data"},
							}).then(resp=>{
								alert(resp.data.msg);
							});
					    
				    },
						
					clkuploadBtn: function(){
					    $("#myPic").click();
					},
					changeImg: function(){
                         //得到文件对象
						 var fileobj = document.getElementById("myPic").files[0];						 
						//得到文件对象的url地址， 设置到img 的src属性上
						$("#myImg").attr("src", URL.createObjectURL(fileobj));
					}
					
					 
				},
				created(){
					axios.get("/ptypes/all").then(resp=>{
						this.ptypelist = resp.data;
					})
				}
			});
			
		</script>
	</body>
</html>
